using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

namespace Roots
{
    public class Game : MonoBehaviour
    {
        /// <summary>
        /// �Ƿ񿴹��̳�
        /// </summary>
        public static bool TipShowed { get; set; } = false;

        public bool Started { get; private set; } = false;
        public bool Paused { get; private set; } = false;

        public void StartGame() => Started = true;

        /// <summary>
        /// ���¶�ȡ����
        /// </summary>
        public void Restart()
        {
            Time.timeScale = 1f;
            SceneManager.LoadScene(gameObject.scene.buildIndex);
        }

        /// <summary>
        /// �˳���Ϸ
        /// </summary>
        public void Quit()
        {
            SceneManager.LoadScene(0);
            Time.timeScale = 1f;
        }

        /// <summary>
        /// �л���ͣ/����
        /// </summary>
        public void TogglePause()
        {
            Paused = !Paused;
            Time.timeScale = Paused ? 0f : 1f;
        }

        public void GameOver()
        {
            Started = false;
        }
    }
}